package chapter2.section4;

/**
 * 程序2-6：字符串的比较
 *
 * @author 作者姓名
 */
public class StringDemo {
    public static void main(String[] args) {
        String s1 = "Morning!";
        String s2 = "morning!";
        boolean eq = s1.equals(s2);
        System.out.println("\"Morning\".equals(\"morning\")结果是" + eq);
        int res = s1.compareTo(s2);
        System.out.println("\"Morning\".compareTo(\"morning\")结果是" + res);
    }
}
 